deploy{
  final DeploymentUnit deploymentUnit=phaseContext.getDeploymentUnit();
  final WeldDeploymentMetadata cdiDeploymentMetadata=deploymentUnit.getAttachment(WeldDeploymentMetadata.ATTACHMENT_KEY);
  final DeploymentReflectionIndex reflectionIndex=deploymentUnit.getAttachment(Attachments.REFLECTION_INDEX);
  if (!WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) {
    return;
  final String beanArchiveIdPrefix;
  if (deploymentUnit.getParent() == null) {
 else {
  final Set<BeanDeploymentArchiveImpl> beanDeploymentArchives=new HashSet<BeanDeploymentArchiveImpl>();
  WeldLogger.DEPLOYMENT_LOGGER.processingWeldDeployment(phaseContext.getDeploymentUnit().getName());
  final Map<ResourceRoot,Index> indexes=AnnotationIndexUtils.getAnnotationIndexes(deploymentUnit);
  final Map<ResourceRoot,BeanDeploymentArchiveImpl> bdaMap=new HashMap<ResourceRoot,BeanDeploymentArchiveImpl>();
  final Module module=phaseContext.getDeploymentUnit().getAttachment(Attachments.MODULE);
  BeanDeploymentArchiveImpl rootBda=null;
  if (cdiDeploymentMetadata != null) {
      beanDeploymentArchives.add(bda);
      bdaMap.put(beanArchiveMetadata.getResourceRoot(),bda);
        rootBda=bda;
        deploymentUnit.putAttachment(WeldAttachments.DEPLOYMENT_ROOT_BEAN_DEPLOYMENT_ARCHIVE,bda);
  if (rootBda == null) {
    rootBda=bda;
  processEEComponents(deploymentUnit,bdaMap,rootBda,indexes,reflectionIndex);
  final JpaInjectionServices jpaInjectionServices=new WeldJpaInjectionServices(deploymentUnit,deploymentUnit.getServiceRegistry());
  bdm.addService(JpaInjectionServices.class,jpaInjectionServices);
  deploymentUnit.putAttachment(WeldAttachments.BEAN_DEPLOYMENT_MODULE,bdm);
}
processEEComponents{
  final EEModuleDescription moduleDescription=deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION);
  for (  ComponentDescription component : moduleDescription.getComponentDescriptions()) {
    BeanDeploymentArchiveImpl bda=resolveComponentBda(component.getComponentClassName(),bdaMap,rootBda,indexes);
      final EJBComponentDescription componentDescription=(EJBComponentDescription)component;
      bda.addEjbDescriptor(new EjbDescriptorImpl<Object>(componentDescription,bda,reflectionIndex));
}
resolveComponentBda{
  final DotName className=DotName.createSimple(ejbClassName);
  for (  Map.Entry<ResourceRoot,BeanDeploymentArchiveImpl> entry : bdaMap.entrySet()) {
    final Index index=indexes.get(entry.getKey());
      if (index.getClassByName(className) != null) {
  return rootBda;
}
createBeanDeploymentArchive{
  Set<String> classNames=new HashSet<String>();
  if (index != null) {
      classNames.add(classInfo.name().toString());
  return new BeanDeploymentArchiveImpl(classNames,beanArchiveMetadata.getBeansXml(),module,beanArchivePrefix + beanArchiveMetadata.getResourceRoot().getRoot().getPathName());
}
undeploy{ }
